import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

// 对element进行导入
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

// 全局样式文件
// 在脚手架中提供loader
import '@/styles/index.scss' // global css

// 导入跟组件
import App from './App'

// 多语言配置
import i18n from '@/lang'

// 导入vuex store 数据仓库
import store from './store'

// 导入路由
import router from './router'

import '@/icons' // icon
// 配置权限的地方.例如:导航守卫
import '@/permission' // permission control

// 导入全局挂载的组件
import Components from './components'
Vue.use(Components)

// 导入全局挂载的组件
import Directive from './directive'
Vue.use(Directive)
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */

// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
